'''
Created on Jan 11, 2013

@author: mmoran
'''
import datetime
from google.appengine.ext import db


class AUser(db.Model):
    first_name = db.StringProperty(required=True)
    last_name = db.StringProperty(required=True)
    email = db.StringProperty(required=False)
    username = db.StringProperty(required=True)
    password = db.StringProperty(required=True)


class Observable(db.Model):
	owner = db.ReferenceProperty(AUser)
	uid = db.StringProperty(required=True)
	name = db.StringProperty()
	screen_name = db.StringProperty()
	profile_image_url = db.StringProperty()


class Aggressor(db.Model):
	uid = db.StringProperty(required=True)
	screen_name = db.StringProperty(required=True)
	name = db.StringProperty(required=True)
	profile_image_url = db.StringProperty()
	ranking = db.IntegerProperty(default=0)
	reports = db.ListProperty(db.Key)


class Report(db.Model):
	victim = db.ReferenceProperty(Observable)
	aggressor = db.ReferenceProperty(Aggressor)
	rank = db.IntegerProperty()
	text = db.StringProperty()
	created_at = db.DateTimeProperty(auto_now_add=True)
	modified_at = db.DateTimeProperty(auto_now=True) 
	checked = db.BooleanProperty(default=False)

